<template>
    <div>
        <!-- 使用三级联动全局组件，无须再次引入 -->
        <TypeNav></TypeNav>
        <ListContainer></ListContainer>
        <Recommend></Recommend>
        <Rank></Rank>
        <Like></Like>
        <Floor v-for="(floor, index) in floorList" :key="floor.id" :list="floor"></Floor>
        <Brand></Brand>
    </div>
</template>

<script>
//引入其余组件
import ListContainer from './ListContainer/index.vue'
import Recommend from './Recommend/index.vue'
import Rank from './Rank/index.vue'
import Like from './Like/index.vue'
import Floor from './Floor/index.vue'
import Brand from './Brand/index.vue'

import { mapState, mapActions, mapMutations, mapGetters } from 'vuex'

export default {
    //注册组件
    components: { ListContainer, Recommend, Rank, Like, Floor, Brand },
    methods: {
        ...mapActions('user', ['getUserInfo'])
    },
    mounted() {
        this.$store.dispatch('home/getFloorList');
        //登陆成功后获取用户信息
        // this.$store.dispatch('user/getUserInfo');
        // window.location.reload();
    },
    computed: {
        ...mapState('home', ['floorList'])
    },
}
</script>

<style lang="scss" scoped></style>